广泛应用在标签打印机上。SDK 中大约有60多条生成指令的函数。
| 类名 | 所在位置 | 功能 |
|---|---|---|
| PTCommandTSPL | PrinterCommand.framework | TSPL 基础指令 |
| PTDispatcher | PrinterDispatch.framework | 与打印机通讯 |
| PTFunctionTSPL | Demo | 对基础指令封装形成功能 |
| PTTestTSPL | Demo | 测试基础指令或封装后的功能 |
一个典型的 TSC-TSPL 指令生成流程如下:
161PTPrinterTSC *tsc = [[PTPrinterTSC alloc] init];23[tsc initCMDQueue]; //初始化命令队列(必要)45[tsc setPrintAreaSizeWithWidth:@"100" Height:@"80"]; //设置打印区域6[tsc setCLS]; //清除缓冲区7[tsc printTexTWithXPos:......]; //打印文本8[tsc printBarCodeWith........]; //打印条形码910[tsc sendCMDQueue];//发送队列中的指令到打印机(必要)1112// NSArray *cmdQueue = [tsc geenrateCMDQueue];或者生成指令,用其他方式发送打印1314/*15必须在设置指令前初始化命令队列(initCMDQueue),设置所有指令后发送指令队列(sendCMDQueue)。16*/